home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / u_man / cat3 / Tk / radiobutton.z / radiobutton
Encoding:
Text File  |  1998-10-30  |  18.8 KB  |  331 lines

  1.  
  2.  
  3.  
  4. rrrraaaaddddiiiioooobbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                              rrrraaaaddddiiiioooobbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      radiobutton - Create and manipulate radiobutton widgets
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      rrrraaaaddddiiiioooobbbbuuuuttttttttoooonnnn _p_a_t_h_N_a_m_e ?_o_p_t_i_o_n_s?
  13.  
  14. SSSSTTTTAAAANNNNDDDDAAAARRRRDDDD OOOOPPPPTTTTIIIIOOOONNNNSSSS
  15.      aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd  ccccuuuurrrrssssoooorrrr               hhhhiiiigggghhhhlllliiiigggghhhhttttTTTThhhhiiiicccckkkknnnneeeessssssss  ttttaaaakkkkeeeeFFFFooooccccuuuussss     |
  16.      aaaaccccttttiiiivvvveeeeFFFFoooorrrreeeeggggrrrroooouuuunnnndddd  ddddiiiissssaaaabbbblllleeeeddddFFFFoooorrrreeeeggggrrrroooouuuunnnndddd   iiiimmmmaaaaggggeeee               tttteeeexxxxtttt          |
  17.      aaaannnncccchhhhoooorrrr            ffffoooonnnntttt                 jjjjuuuussssttttiiiiffffyyyy             tttteeeexxxxttttVVVVaaaarrrriiiiaaaabbbblllleeee  |
  18.      bbbbaaaacccckkkkggggrrrroooouuuunnnndddd        ffffoooorrrreeeeggggrrrroooouuuunnnndddd           ppppaaaaddddXXXX                uuuunnnnddddeeeerrrrlllliiiinnnneeee     |
  19.      bbbbiiiittttmmmmaaaapppp            hhhhiiiigggghhhhlllliiiigggghhhhttttCCCCoooolllloooorrrr       ppppaaaaddddYYYY                wwwwrrrraaaappppLLLLeeeennnnggggtttthhhh    |
  20.      bbbboooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh       hhhhiiiigggghhhhlllliiiigggghhhhttttBBBBaaaacccckkkkggggrrrroooouuuunnnndddd  rrrreeeelllliiiieeeeffff
  21.  
  22.      See the ``options'' manual entry for details on the standard options.
  23.  
  24. WWWWIIIIDDDDGGGGEEEETTTT----SSSSPPPPEEEECCCCIIIIFFFFIIIICCCC OOOOPPPPTTTTIIIIOOOONNNNSSSS
  25.      Name:           ccccoooommmmmmmmaaaannnndddd
  26.      Class:          CCCCoooommmmmmmmaaaannnndddd
  27.      Command-Line Switch:----ccccoooommmmmmmmaaaannnndddd
  28.  
  29.           Specifies a Tcl command to associate with the button.  This command
  30.           is typically invoked when mouse button 1 is released over the button
  31.           window.  The button's global variable (----vvvvaaaarrrriiiiaaaabbbblllleeee option) will be
  32.           updated before the command is invoked.
  33.  
  34.      Name:           hhhheeeeiiiigggghhhhtttt
  35.      Class:          HHHHeeeeiiiigggghhhhtttt
  36.      Command-Line Switch:----hhhheeeeiiiigggghhhhtttt
  37.  
  38.           Specifies a desired height for the button.  If an image or bitmap is
  39.           being displayed in the button then the value is in screen units
  40.           (i.e. any of the forms acceptable to TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss); for text it is
  41.           in lines of text.  If this option isn't specified, the button's
  42.           desired height is computed from the size of the image or bitmap or
  43.           text being displayed in it.
  44.  
  45.      Name:           iiiinnnnddddiiiiccccaaaattttoooorrrrOOOOnnnn                                              |
  46.      Class:          IIIInnnnddddiiiiccccaaaattttoooorrrrOOOOnnnn                                              |
  47.      Command-Line Switch:----iiiinnnnddddiiiiccccaaaattttoooorrrroooonnnn                                         |
  48.  
  49.           Specifies whether or not the indicator should be drawn.  Must be a  |
  50.           proper boolean value.  If false, the rrrreeeelllliiiieeeeffff option is ignored and   |
  51.           the widget's relief is always sunken if the widget is selected and  |
  52.           raised otherwise.
  53.  
  54.      Name:           sssseeeelllleeeeccccttttCCCCoooolllloooorrrr                                              |
  55.      Class:          BBBBaaaacccckkkkggggrrrroooouuuunnnndddd                                               |
  56.      Command-Line Switch:----sssseeeelllleeeeccccttttccccoooolllloooorrrr                                         |
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. rrrraaaaddddiiiioooobbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                              rrrraaaaddddiiiioooobbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  71.  
  72.  
  73.  
  74.           Specifies a background color to use when the button is selected.  If|
  75.           iiiinnnnddddiiiiccccaaaattttoooorrrrOOOOnnnn is true, the color applicies to the indicator.  If      |
  76.           iiiinnnnddddiiiiccccaaaattttoooorrrrOOOOnnnn is false, this color is used as the background for the  |
  77.           entire widget, in place of bbbbaaaacccckkkkggggrrrroooouuuunnnndddd or aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd, whenever |
  78.           the widget is selected.  If specified as an empty string, no special|
  79.           color is used for displaying when the widget is selected.
  80.  
  81.      Name:           sssseeeelllleeeeccccttttIIIImmmmaaaaggggeeee                                              |
  82.      Class:          SSSSeeeelllleeeeccccttttIIIImmmmaaaaggggeeee                                              |
  83.      Command-Line Switch:----sssseeeelllleeeeccccttttiiiimmmmaaaaggggeeee                                         |
  84.  
  85.           Specifies an image to display (in place of the iiiimmmmaaaaggggeeee option) when   |
  86.           the radiobutton is selected.  This option is ignored unless the     |
  87.           iiiimmmmaaaaggggeeee option has been specified.
  88.  
  89.      Name:           ssssttttaaaatttteeee
  90.      Class:          SSSSttttaaaatttteeee
  91.      Command-Line Switch:----ssssttttaaaatttteeee
  92.  
  93.           Specifies one of three states for the radiobutton:  nnnnoooorrrrmmmmaaaallll, aaaaccccttttiiiivvvveeee,
  94.           or ddddiiiissssaaaabbbblllleeeedddd.  In normal state the radiobutton is displayed using the
  95.           ffffoooorrrreeeeggggrrrroooouuuunnnndddd and bbbbaaaacccckkkkggggrrrroooouuuunnnndddd options.  The active state is typically
  96.           used when the pointer is over the radiobutton.  In active state the
  97.           radiobutton is displayed using the aaaaccccttttiiiivvvveeeeFFFFoooorrrreeeeggggrrrroooouuuunnnndddd and
  98.           aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd options.  Disabled state means that the radiobutton|
  99.           should be insensitive:  the default bindings will refuse to activate|
  100.           the widget and will ignore mouse button presses.  In this state the
  101.           ddddiiiissssaaaabbbblllleeeeddddFFFFoooorrrreeeeggggrrrroooouuuunnnndddd and bbbbaaaacccckkkkggggrrrroooouuuunnnndddd options determine how the
  102.           radiobutton is displayed.
  103.  
  104.      Name:           vvvvaaaalllluuuueeee
  105.      Class:          VVVVaaaalllluuuueeee
  106.      Command-Line Switch:----vvvvaaaalllluuuueeee
  107.  
  108.           Specifies value to store in the button's associated variable
  109.           whenever this button is selected.
  110.  
  111.      Name:           vvvvaaaarrrriiiiaaaabbbblllleeee
  112.      Class:          VVVVaaaarrrriiiiaaaabbbblllleeee
  113.      Command-Line Switch:----vvvvaaaarrrriiiiaaaabbbblllleeee
  114.  
  115.           Specifies name of global variable to set whenever this button is
  116.           selected.  Changes in this variable also cause the button to select
  117.           or deselect itself.  Defaults to the value sssseeeelllleeeecccctttteeeeddddBBBBuuuuttttttttoooonnnn.
  118.  
  119.      Name:           wwwwiiiiddddtttthhhh
  120.      Class:          WWWWiiiiddddtttthhhh
  121.      Command-Line Switch:----wwwwiiiiddddtttthhhh
  122.  
  123.           Specifies a desired width for the button.  If an image or bitmap is
  124.           being displayed in the button, the value is in screen units (i.e.
  125.           any of the forms acceptable to TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss); for text it is in
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. rrrraaaaddddiiiioooobbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                              rrrraaaaddddiiiioooobbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  137.  
  138.  
  139.  
  140.           characters.  If this option isn't specified, the button's desired
  141.           width is computed from the size of the image or bitmap or text being
  142.           displayed in it.
  143.  
  144.  
  145. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  146.      The rrrraaaaddddiiiioooobbbbuuuuttttttttoooonnnn command creates a new window (given by the _p_a_t_h_N_a_m_e
  147.      argument) and makes it into a radiobutton widget.  Additional options,
  148.      described above, may be specified on the command line or in the option
  149.      database to configure aspects of the radiobutton such as its colors,
  150.      font, text, and initial relief.  The rrrraaaaddddiiiioooobbbbuuuuttttttttoooonnnn command returns its
  151.      _p_a_t_h_N_a_m_e argument.  At the time this command is invoked, there must not
  152.      exist a window named _p_a_t_h_N_a_m_e, but _p_a_t_h_N_a_m_e's parent must exist.
  153.  
  154.      A radiobutton is a widget that displays a textual string, bitmap or image|
  155.      and a diamond called an _i_n_d_i_c_a_t_o_r.  If text is displayed, it must all be |
  156.      in a single font, but it can occupy multiple lines on the screen (if it  |
  157.      contains newlines or if wrapping occurs because of the wwwwrrrraaaappppLLLLeeeennnnggggtttthhhh option)|
  158.      and one of the characters may optionally be underlined using the         |
  159.      uuuunnnnddddeeeerrrrlllliiiinnnneeee option.  A radiobutton has all of the behavior of a simple
  160.      button: it can display itself in either of three different ways,
  161.      according to the ssssttttaaaatttteeee option; it can be made to appear raised, sunken,
  162.      or flat; it can be made to flash; and it invokes a Tcl command whenever
  163.      mouse button 1 is clicked over the check button.
  164.  
  165.      In addition, radiobuttons can be _s_e_l_e_c_t_e_d.  If a radiobutton is selected,|
  166.      the indicator is normally drawn with a sunken relief and a special color,|
  167.      and a Tcl variable associated with the radiobutton is set to a particular|
  168.      value.  If the radiobutton is not selected, the indicator is drawn with a|
  169.      raised relief and no special color.  Typically, several radiobuttons     |
  170.      share a single variable and the value of the variable indicates which    |
  171.      radiobutton is to be selected.  When a radiobutton is selected it sets   |
  172.      the value of the variable to indicate that fact;  each radiobutton also  |
  173.      monitors the value of the variable and automatically selects and         |
  174.      deselects itself when the variable's value changes.  By default the      |
  175.      variable sssseeeelllleeeecccctttteeeeddddBBBBuuuuttttttttoooonnnn is used;  its contents give the name of the      |
  176.      button that is selected, or the empty string if no button associated with|
  177.      that variable is selected.  The name of the variable for a radiobutton,  |
  178.      plus the variable to be stored into it, may be modified with options on  |
  179.      the command line or in the option database.  Configuration options may   |
  180.      also be used to modify the way the indicator is displayed (or whether it |
  181.      is displayed at all).  By default a radio button is configured to select
  182.      itself on button clicks.
  183.  
  184.  
  185. WWWWIIIIDDDDGGGGEEEETTTT CCCCOOOOMMMMMMMMAAAANNNNDDDD
  186.      The rrrraaaaddddiiiioooobbbbuuuuttttttttoooonnnn command creates a new Tcl command whose name is _p_a_t_h_N_a_m_e.
  187.      This command may be used to invoke various operations on the widget.  It
  188.      has the following general form:
  189.  
  190.           _p_a_t_h_N_a_m_e _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. rrrraaaaddddiiiioooobbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                              rrrraaaaddddiiiioooobbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  203.  
  204.  
  205.  
  206.      _O_p_t_i_o_n and the _a_r_gs determine the exact behavior of the command.  The
  207.      following commands are possible for radiobutton widgets:
  208.  
  209.      _p_a_t_h_N_a_m_e ccccggggeeeetttt _o_p_t_i_o_n
  210.           Returns the current value of the configuration option given by      |
  211.           _o_p_t_i_o_n.  _O_p_t_i_o_n may have any of the values accepted by the          |
  212.           rrrraaaaddddiiiioooobbbbuuuuttttttttoooonnnn command.
  213.  
  214.      _p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee ?_o_p_t_i_o_n? ?_v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  215.           Query or modify the configuration options of the widget.  If no
  216.           _o_p_t_i_o_n is specified, returns a list describing all of the available
  217.           options for _p_a_t_h_N_a_m_e (see TTTTkkkk____CCCCoooonnnnffffiiiigggguuuurrrreeeeIIIInnnnffffoooo for information on the
  218.           format of this list).  If _o_p_t_i_o_n is specified with no _v_a_l_u_e, the
  219.           command returns a list describing the one named option (this list
  220.           will be identical to the corresponding sublist of the value returned
  221.           if no _o_p_t_i_o_n is specified).  If one or more _o_p_t_i_o_n-_v_a_l_u_e pairs are
  222.           specified, the command modifies the given widget option(s) to have
  223.           the given value(s);  in this case the command returns an empty
  224.           string.  _O_p_t_i_o_n may have any of the values accepted by the
  225.           rrrraaaaddddiiiioooobbbbuuuuttttttttoooonnnn command.
  226.  
  227.      _p_a_t_h_N_a_m_e ddddeeeesssseeeelllleeeecccctttt
  228.           Deselects the radiobutton and sets the associated variable to an
  229.           empty string.  If this radiobutton was not currently selected, the
  230.           command has no effect.
  231.  
  232.      _p_a_t_h_N_a_m_e ffffllllaaaasssshhhh
  233.           Flashes the radiobutton.  This is accomplished by redisplaying the
  234.           radiobutton several times, alternating between active and normal
  235.           colors.  At the end of the flash the radiobutton is left in the same
  236.           normal/active state as when the command was invoked.  This command
  237.           is ignored if the radiobutton's state is ddddiiiissssaaaabbbblllleeeedddd.
  238.  
  239.      _p_a_t_h_N_a_m_e iiiinnnnvvvvooookkkkeeee
  240.           Does just what would have happened if the user invoked the
  241.           radiobutton with the mouse: selects the button and invokes its
  242.           associated Tcl command, if there is one.  The return value is the
  243.           return value from the Tcl command, or an empty string if there is no
  244.           command associated with the radiobutton.  This command is ignored if
  245.           the radiobutton's state is ddddiiiissssaaaabbbblllleeeedddd.
  246.  
  247.      _p_a_t_h_N_a_m_e sssseeeelllleeeecccctttt
  248.           Selects the radiobutton and sets the associated variable to the
  249.           value corresponding to this widget.
  250.  
  251.  
  252. BBBBIIIINNNNDDDDIIIINNNNGGGGSSSS
  253.      Tk automatically creates class bindings for radiobuttons that give them
  254.      the following default behavior:
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. rrrraaaaddddiiiioooobbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))                                              rrrraaaaddddiiiioooobbbbuuuuttttttttoooonnnn((((3333TTTTkkkk))))
  269.  
  270.  
  271.  
  272.      [1]  The radiobutton activates whenever the mouse passes over it and
  273.           deactivates whenever the mouse leaves the radiobutton.
  274.  
  275.      [2]  When mouse button 1 is pressed over a radiobutton it is invoked (it |
  276.           becomes selected and the command associated with the button is      |
  277.           invoked, if there is one).
  278.  
  279.      [3]  When a radiobutton has the input focus, the space key causes the    |
  280.           radiobutton to be invoked.
  281.  
  282.      If the radiobutton's state is ddddiiiissssaaaabbbblllleeeedddd then none of the above actions
  283.      occur:  the radiobutton is completely non-responsive.
  284.  
  285.      The behavior of radiobuttons can be changed by defining new bindings for
  286.      individual widgets or by redefining the class bindings.
  287.  
  288.  
  289. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  290.      radiobutton, widget
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.